<?php $this->load->view('inc/header.php');?>

<div class="b2"></div>

<div class="panel w2">
<?php $this->load->view('user/inc_nav.php');?>
		
	<div class="b2"></div>
	
	<form id="frm-setting_pass" action="<?php echo site_url('c=user&m=setting_pass_do');?>"
		submitbefor="frm_mpass_befor"
	>

	<table class="tbl-frm-1">
		
		<tr>
			<th width="60">旧密码：</th>
			<td>
				<input type="password" class="inp" name="opass"/>
				<span id="tip-opass" class="tip"></span>
			</td>
		</tr>
		<tr>
			<th width="60">新密码：</th>
			<td>
				<input type="password" class="inp" name="upass"/>
				<span id="tip-upass" class="tip"></span>
			</td>
		</tr>
		<tr>
			<th>&nbsp;</th>
			<td class="p1">
				<input class="btn-ajax-submit btn-4" frmid="frm-setting_pass" type="button" value="保 存"/>
			</td>
		</tr>
	
	</table>
	</form>	
</div>

<?php $this->load->view('inc/footer.php');?>


<script>
function frm_mpass_befor($frm){

	$frm.find('.c1').removeClass('c1');
	var password = $frm.find('input[name=opass]').val().trim();
	if(password.length == 0){
		$('#tip-opass').addClass('c1').html('').html('旧密码不能为空！');
	}else{
		$('#tip-opass').html('');	
	} 

	var password = $frm.find('input[name=upass]').val().trim();
	if(password.length == 0){
		$('#tip-upass').addClass('c1').html('').html('新密码不能为空！');
	}else if(password.length != 0 && !isUpass(password)){
		$('#tip-upass').addClass('c1').html('').html('错误的格式！');	
	}else{
		$('#tip-upass').html('');	
	} 

	if($frm.find('.c1').size()>0) return false;
	
	return true;	
	
}
</script>